﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace System
{
	internal sealed class ParentNodeClass
	{
		public PropertyInfo ParentProperty { get; set; }

		public ParentNodeClass(Type type)
		{
			Load(type);
		}

		public void Load(Type type)
		{
			foreach (PropertyInfo prop in type.GetProperties(BindingFlags.NonPublic
					| BindingFlags.Public
					| BindingFlags.Instance
					| BindingFlags.Static))
			{
				if (prop.GetCustomAttributes(typeof(ParentNodeAttribute), true).Length > 0)
				{
					ParentProperty = prop;
				}
			}
		}
	}
}
